{extend name="Index/index" /}

{block name="main"}

<script>
    $(function () {
        $('#cinema').change(function () {
            //一触发就清空后面select框的内容
            $('#hall').show().empty();
            //获取当前的value值
            var id = $(this).val();
            var _this = $(this);
            //通过ajax 请求下一级的数据
            $.ajax({
                type: 'get',
                url: '/ajaxstudio/' + id,
                success: function (data) {

                    for (var i = 0; i < data.length; i++) {
                        $('<option value="' + data[i].id + '">' + data[i].studio_name + '</option>').appendTo($('#hall'));
                    }
                }
            })
        });
        $('#cinema').trigger('change');
    });


    $(function () {
        $('#time-n').change(function () {
            //一触发就清空后面select框的内容
            $('#time-j').show().empty();
            //获取当前的value值
            var iid = $(this).val();
            var _this = $(this);
            //通过ajax 请求下一级的数据
            $.ajax({
                type: 'get',
                url: '/ajaxdate/' + iid,
                success: function (data) {

                    for (var i = 1; i <= data; i++) {
                        $('<option value="' + i + '">' + i + '</option>').appendTo($('#time-j'));
                    }
                }
            });
        })
        $('#time-n').trigger('change');
    });
</script>

<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">排片添加</h3>
    </div>
    <div class="panel-body">
        
        
        
    <table cellspacing="0" class="table table-small-font table-bordered table-striped table-hover text-center">
        <thead>
            <form action="{:url('admin/Sort/save')}" method="post" enctype="multipart/form-data">

              <div class="form-group">
                <label for="exampleInputState" style="color:#00a6ac;">选择影院</label>
                   <select id="cinema" class="form-control" name="cinema" require>
                      {volist name="cinema" id="val"}
                      <option value="{$val['id']}">{$val['cinema']}</option>
                      {/volist}
                    </select>
              </div><!--END-->

              <div class="form-group">
                <label for="exampleInputState" style="color:#00a6ac;">选择影厅</label>
                   <select id="hall" class="form-control" name="studio" id="exampleInputState" require>
                    </select>
              </div><!--END-->

              <div class="form-group">
                <label for="exampleInputTongue" style="color:#00a6ac;">选择影片</label>
                   <select class="form-control" name="film" id="exampleInputTongue" require>
                       {volist name="film" id="v"}
                       <option value="{$v.id}">{$v.filmname}</option>
                       {/volist}
                    </select>
              </div><!--END-->

                <div class="form-group">
                <div class="row">
                    <div class="col-md-6">
                    <label for="exampleInputselect1" style="color:#00a6ac;">几月</label>
                    <select id="time-n" class="form-control" name="time-n" id="exampleInputselect1">
                    {for start="$n" end="13"}
                    <option value="{$i}">{$i}</option>
                    {/for}
                    </select>
                </div>
                 <div class="col-md-6">
                 <label for="exampleInputselect1" style="color:#00a6ac;">几号</label>
                    <select id="time-j" class="form-control" name="time-j">

                    </select>
                </div>
                </div>
              </div><!--END-->


              <div class="form-group">
              <label for="exampleInputselect1" style="color:#00a6ac;">开始时间</label>
                <div class="row">
                    <div class="col-md-6">
                    <select id="time-n" class="form-control" name="time-h" id="exampleInputselect1">
                    {for start="1" end="25"}
                    <option value="{$i}">{$i}时</option>
                    {/for}
                    </select>
                </div>
                 <div class="col-md-6">
                    <select id="time-j" class="form-control" name="time-i">
                    {for start="0" end="61"}
                    <option value="0{$i}">{$i}分</option>
                    {/for}
                    </select>
                </div>
                </div>
              </div><!--END-->

              <div class="form-group">
                <label for="exampleInputName" style="color:#00a6ac;">此场定价</label>
                <input type="text" name="price" class="form-control text-center" id="exampleInputName" placeholder="Price" required>
              </div><!--END-->


              <button type="submit" class="btn btn-info" style="border-radius:10px;">确定排片日期</button>
            </form>
        </thead>
    </table>
    </div>
</div>
{/block}